feat: openkal 0.1.0 + openkal-linux 0.1.0, std-freestanding 0.2.0, riscv-virt-rt 0.3.0 - #220
Merged
Conversation
…d library `import std;` is one module over the whole library, so there is no subset of IT to build without an OS — mcpp turns it off on a freestanding target and says so. But libc++'s HEADERS are almost entirely freestanding-capable already; what stops them is one per-target file, `__config_site`, which the toolchain ships only for its own host triple. Synthesising that file is this package's job. 103 of libc++'s 110 headers compile for riscv64-none-elf. The other 7 (generator, hazard_pointer, rcu, spanstream, stacktrace, stdfloat, text_encoding) fail on an x86_64 host with full libc++ and glibc too — they are headers libc++ has not implemented, so the freestanding loss at compile time is zero. The package's regeneration script prints that control group on every run. Verified running under qemu: array, span, optional, atomic, string_view, and ranges::sort with a projection. `xim:llvm` is an install-time dependency because that is where libc++'s headers live. Nothing is linked from it — the package includes them privately and exports a module — but without the payload there is nothing to include, and the failure would surface as "file not found" inside a module compile instead of as a missing dependency. Requires mcpp >= 2026.8.19.4: earlier versions do not put `-fno-exceptions` on a freestanding target, and `std::optional::value()` alone then pulls in `__cxa_throw` and three more symbols that cannot exist without an unwinder.
Sunrisepeak
marked this pull request as draft
August 19, 2026 05:01
…its C library
Both packages declared `xim:picolibc-riscv@1.8.12`, and the standard-library
subset also declared `xim:llvm`. That pinned a board package and an
implementation-neutral library alike to one C library, one architecture, one
toolchain and one version of each — none of which is a property of either.
mcpp 2026.8.19.4 resolves the target's C library from the target's own row, the
way it resolves the compiler: a hosted project never declared glibc, and a
bare-metal one no longer declares picolibc. So:
* std-freestanding 0.2.0 declares NOTHING. It asks mcpp where the toolchain's
headers are, and the target's C headers are already on the compile line.
* riscv-virt-rt 0.3.0 declares only the emulator, which is the one xim
package that really is a board fact. Its linker line is bare names now,
because the search path is there before it says anything.
riscv-virt-rt 0.1.0 and 0.2.0 stay listed — published versions someone may have
pinned. std-freestanding 0.1.0 is replaced rather than kept: it never reached
this index, and it is wrong by construction.
Both new versions require mcpp >= 2026.8.19.4.
openkal is a portable kernel application binary interface. The specification
package carries the normative declarations and no definitions; the
implementation package supplies the definitions for Linux and is maintained as
the worked example other implementations follow.
A consuming project declares both. The first dependency fixes the version of
the contract the project is written against; the second selects an
implementation and is ordinarily conditional on the target, so that changing
implementation is a change to one line of the manifest and to no line of the
source.
[dependencies]
openkal = "0.1.0"
[target.'cfg(os = "linux")'.dependencies]
openkal-linux = "0.1.0"
Neither descriptor declares xim dependencies. The specification package needs
no payload because it defines nothing, and the implementation uses the host C
library that mcpp already supplies for a hosted target.
Sunrisepeak
marked this pull request as ready for review
August 19, 2026 19:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four packages, in two groups.
openkal
A portable kernel application binary interface. The specification package
carries the normative declarations and no definitions; the implementation
package supplies them for Linux and is maintained as the worked example other
implementations follow.
A consuming project declares both: the first fixes the version of the contract
it is written against, the second selects an implementation. Changing
implementation is a change to one line of the manifest and to no line of the
source, which is demonstrated in the specification repository by an example
that builds one unmodified source against two implementations.
Bare metal
std-freestanding 0.2.0 and riscv-virt-rt 0.3.0 stop declaring the target's C
library. mcpp 2026.8.19.4 resolves it from the target's own row, the way it
resolves the compiler, so a bare-metal project no longer declares picolibc any
more than a hosted project declares glibc.
Both new bare-metal versions require mcpp >= 2026.8.19.4. The openkal packages
require nothing beyond a hosted toolchain.